# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Jerome Leclanche <jerome@leclan.ch>

pkgname=foliate
pkgver=3.0.1
pkgrel=2
pkgdesc='A simple and modern GTK eBook reader'
arch=(loong64 x86_64)
url="https://johnfactotum.github.io/$pkgname/"
_url="https://github.com/johnfactotum/$pkgname"
license=(GPL3)
depends=(gjs
         gtk4
         libadwaita
         # iso-codes
         webkitgtk-6.0)
makedepends=(gettext
             meson
             ninja)
optdepends=(#'dictd: Offline dictionary support'
            'espeak-ng: Text-to-speech support; also voice package needed'
            'festival: Text-to-speech support; also voice package needed'
            'gspell: Spell-checking support'
            'hyphen: Auto-hyphenation support'
            'tracker3')
_archive="com.github.johnfactotum.${pkgname^}-$pkgver"
source=("$_url/releases/download/$pkgver/$_archive.tar.xz")
sha256sums=('e95c31848500ab408e2498cc3331a367e4037e8f2e7f952a054f9dd04d5fe3ee')

build() {
	cd "$_archive"
	meson build --prefix=/usr
	ninja -C build
}

package() {
	cd "$_archive"
	DESTDIR="$pkgdir" ninja -C build install
}
